depends on X86_XEN
default y
-config X86_SYSENTER
- bool
- depends on !X86_NO_TSS
- default y
-
config X86_NO_IDT
bool
depends on X86_XEN
vsyscall_note := vsyscall-note.o
endif
-VSYSCALL_TYPES-y := int80
-VSYSCALL_TYPES-$(CONFIG_X86_SYSENTER) += sysenter
# vsyscall.o contains the vsyscall DSO images as __initdata.
# We must build both images before we can assemble it.
# Note: kbuild does not track this dependency due to usage of .incbin
-$(obj)/vsyscall.o: $(foreach F,$(VSYSCALL_TYPES-y),$(obj)/vsyscall-$F.so)
-targets += $(foreach F,$(VSYSCALL_TYPES-y),vsyscall-$F.o vsyscall-$F.so)
-targets += $(vsyscall_note) vsyscall.lds
+$(obj)/vsyscall.o: $(obj)/vsyscall-int80.so $(obj)/vsyscall-sysenter.so
+targets += $(foreach F,int80 sysenter,vsyscall-$F.o vsyscall-$F.so)
+targets += vsyscall-note.o vsyscall.lds
# The DSO images are built using a special linker script.
quiet_cmd_syscall = SYSCALL $@
SYSCFLAGS_vsyscall-syms.o = -r
$(obj)/vsyscall-syms.o: $(src)/vsyscall.lds \
- $(foreach F,$(VSYSCALL_TYPES-y),$(obj)/vsyscall-$F.o) \
- $(obj)/$(vsyscall_note) FORCE
+ $(obj)/vsyscall-sysenter.o $(obj)/$(vsyscall_note) FORCE
$(call if_changed,syscall)
ifdef CONFIG_XEN
OFFSET(pbe_orig_address, pbe, orig_address);
OFFSET(pbe_next, pbe, next);
-#ifdef CONFIG_X86_SYSENTER
+#ifndef CONFIG_X86_NO_TSS
/* Offset from the sysenter stack to tss.esp0 */
DEFINE(TSS_sysenter_esp0, offsetof(struct tss_struct, esp0) -
sizeof(struct tss_struct));
+#else
+ /* sysenter stack points directly to esp0 */
+ DEFINE(TSS_sysenter_esp0, 0);
#endif
DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
jmp need_resched
#endif
-#ifdef CONFIG_X86_SYSENTER
/* SYSENTER_RETURN points to after the "sysenter" instruction in
the vsyscall page. See vsyscall-sysentry.S, which defines the symbol. */
xorl %ebp,%ebp
sti
sysexit
-#endif /* CONFIG_X86_SYSENTER */
# system call handler stub
call math_state_restore
jmp ret_from_exception
-#ifdef CONFIG_X86_SYSENTER
+#ifndef CONFIG_XEN
/*
* Debug traps and NMI can happen at the one SYSENTER instruction
* that sets up the real kernel stack. Check here, since we can't
pushfl; \
pushl $__KERNEL_CS; \
pushl $sysenter_past_esp
-#endif /* CONFIG_X86_SYSENTER */
+#endif /* CONFIG_XEN */
KPROBE_ENTRY(debug)
-#ifdef CONFIG_X86_SYSENTER
+#ifndef CONFIG_XEN
cmpl $sysenter_entry,(%esp)
jne debug_stack_correct
FIX_STACK(12, debug_stack_correct, debug_esp_fix_insn)
debug_stack_correct:
-#endif /* !CONFIG_X86_SYSENTER */
+#endif /* !CONFIG_XEN */
pushl $-1 # mark this as an int
SAVE_ALL
xorl %edx,%edx # error code 0
void enable_sep_cpu(void)
{
-#ifdef CONFIG_X86_SYSENTER
+#ifndef CONFIG_X86_NO_TSS
int cpu = get_cpu();
struct tss_struct *tss = &per_cpu(init_tss, cpu);
{
syscall_page = (void *)get_zeroed_page(GFP_ATOMIC);
-#ifdef CONFIG_X86_SYSENTER
if (boot_cpu_has(X86_FEATURE_SEP)) {
memcpy(syscall_page,
&vsyscall_sysenter_start,
&vsyscall_sysenter_end - &vsyscall_sysenter_start);
return 0;
}
-#endif
memcpy(syscall_page,
&vsyscall_int80_start,
.incbin "arch/i386/kernel/vsyscall-int80.so"
vsyscall_int80_end:
-#ifdef CONFIG_X86_SYSENTER
.globl vsyscall_sysenter_start, vsyscall_sysenter_end
vsyscall_sysenter_start:
.incbin "arch/i386/kernel/vsyscall-sysenter.so"
vsyscall_sysenter_end:
-#endif
__FINIT
static inline void __load_esp0(struct tss_struct *tss, struct thread_struct *thread)
{
tss->esp0 = thread->esp0;
-#ifdef CONFIG_X86_SYSENTER
/* This can only happen when SEP is enabled, no need to test "SEP"arately */
if (unlikely(tss->ss1 != thread->sysenter_cs)) {
tss->ss1 = thread->sysenter_cs;
wrmsr(MSR_IA32_SYSENTER_CS, thread->sysenter_cs, 0);
}
-#endif
}
#define load_esp0(tss, thread) \
__load_esp0(tss, thread)